package com.cn.propertyeditor;

import com.cn.domain.Address;

import java.beans.PropertyEditorSupport;

public class AddressPropertyEditor extends PropertyEditorSupport {


	@Override
	public void setAsText(String text) throws IllegalArgumentException {
		String[] split = text.split("-");

		Address address = new Address();
		address.setProvince(split[0]);
		address.setCity(split[1]);
		address.setArea(split[2]);

		setValue(address);
	}
}
